package org.example.system.service;

import org.example.system.entity.CommentNew;
import org.example.system.mapper.CommentNewMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class CommentNewService {
    @Autowired
    private CommentNewMapper commentNewMapper;

    public int add(CommentNew comment) {
        return commentNewMapper.insert(comment);
    }
    public List<CommentNew> findAll() {
        return commentNewMapper.selectAll();
    }
    public int update(CommentNew comment) {
        return commentNewMapper.update(comment);
    }
    public int delete(Long id) {
        return commentNewMapper.deleteById(id);
    }
    public CommentNew findById(Long id) {
        return commentNewMapper.selectById(id);
    }
} 